api sort events by date