Return errors from SSE requests to the client (#670)

* capture errors when handling SSE requests and return them to the client

* refactor handleConnection method into separate methods per message type
9 files changed