added /events endpoint and sending events to client