Moved events logic from RestController to a Proxy.