Add uploadEventsWithCallback() instead of uploadEventsWithBlock() for error handling