Added a default http request handler, refactored the sse related funtions