Hotfix/event manager for resource and controller

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

The above check is because this listener should only run for RestController instances, and be ignored for any other controller type.