Moved http server related out of app