Fix datetime type detection
Json serialization