added some spaghetti code to detect event type
more work-around for non webhook code