solve issue formating datetime to json

prevent TypeError datetime.datime is not JSON serializable