public function sendRequest($req)
    {
        $response = $this->send($req->getJSON());

        if ($response->id != $req->id) {
            throw new Clientside\Exception("Mismatched request id");
        }

        if(isset($response->error_code)) {
            throw new Clientside\Exception("{$response->error_code} {$response->error_message}", $response->error_code);
        }

        return $response->result;
    }