Properly handle the JSON-RPC reply