added event model and database