Refactoring
#6 Added REST support for event handling.