api date handling