This class has nothing to do with JSON. The JSON serialization happens in the middeware wrapper. There we might need to serialize it manually before returning. Surely this is done is other places.