def handle_json(json_str)
      begin
        req  = JSON::parse(json_str)
        resp = handle(req)
      rescue JSON::ParserError => e
        resp = err_resp({ }, -32700, "Unable to parse JSON: #{e.message}")
      end
      
      # Note the `:ascii_only` usage here. Important.
      return JSON::generate(resp, { :ascii_only=>true })
    end
def handle_json(json_str)
      begin
        req  = JSON::parse(json_str)
        resp = handle(req)
      rescue JSON::ParserError => e
        resp = err_resp({ }, -32700, "Unable to parse JSON: #{e.message}")
      end
      
      # Note the `:ascii_only` usage here. Important.
      return JSON::generate(resp, { :ascii_only=>true })
    end
Handles a request encoded as JSON.
 Returns the result as a JSON encoded string.