refactored the server to use express router.