Add trigger eventsApi tests and fix trigger