Add support for auto-registering rpc calls to api.