implemented module as middleware using express.Router