use DjangoJSONEncoder to ensure that dates can be serialized