restructured the routes and handlers
adding logging support