refactoring the base http stuff out from the server