moved get_events to payload.py