Created JSON RPC middleware to handle other middlewares