add support for API versioning, including v2 support for events