cleaned up code and made the http server respond