Moved base event listener to api to simplify event handler