Improve router and add http request handler