added router and implemented handler to route requests