Moved stuff into the HTTP server from main.js