Fix JSON fetch exception

In a similar way as in:
https://github.com/changa/active_model_serializers/commit/55425c597aefbfd330ee280c1f1dd6b4166c2141