setup database and bundled
wrote tests and fixed bug in events_controller