API improvements for events