Added support for reading events from the database