Add API for events. Add tests for events. Add event API documentation to README.