event api tests and bugfixes