Emit events for error and success

Fixes #19
Merge pull request #29 from begriffs/events

Emit events for error and success