Initial implementation of event API.