moving routes and middleware to config folder