Add get events count API.