Added functionality to create events.