updated json encoder to support datetime in YYYY-MM-DD HH:mm:ssZ format, backwards compatibility