adding support for eventing in the core
refactoring request handling to make it, hopefully, clearer