rpc module which can be extended by middlewares like express.js