Refactor tests related to serializers and JSON content