connect to /api/events