completed basic rpc implementation