add generic controller to manage events in a declarative way