refactored the eventsource endpoint to make it testable. Added some basic smoke test.