Added event API functionality