event api is now more js-friendly