refactored eventsource out of app.js