Refactored a bit, implemented HTTP server