solve issue formating datetime to json

prevent getting TypeError datetime.datime is not JSON serializable