added unit tests for events API