refactor createEvent api