Middleware based routing for creating json based APIs on top of express 4