Defining an RPC method to persist objects