Only look for datetimes if you get a dict back (e.g., not for relationship_name() call)

Custom encoder for datetimes