Sanitize event names in API queries