Docs: added events, updated API and cleaned up