events api library for javascript