Hotfix/event manager for resource and controller

* Fixed Resource and Controller event manager.
* Fixed detaching RestParametersListener.

Actually, this makes sense -- otherwise, the same instance is used for both the resource and the controller, which means that identifiers get either overwritten or mixed together.