implemented callbacks in RPC