Added typing and tests for event-handler