Start moving events to the API package.

Signed-off-by: Sleaker <sleaker@gmail.com>
Merge pull request #512 from Sleaker/master

move events to the API package