When the content returned by a controller is an instance of ArrayObject, serialize it as Json