fix API for addEvents. Add support for getEvents