make json work with and without serializer