Events and API in example