adding events tests and refactored controller