reconfigured server and routes to use Router for routes