Implement json-rpc protocol