def format_json(json_output)
        unless json_output.is_a?(String)
          json_engine = Rabl.configuration.json_engine
          json_output = if json_engine.respond_to?(:dump)
            json_engine.dump(json_output)
          else
            json_engine.encode(json_output)
          end
        end

        use_callback = Rabl.configuration.enable_json_callbacks && request_params[:callback].present?
        json_output = "#{request_params[:callback]}(#{json_output})" if use_callback

        json_output
      end
def format_json(json_output)
        unless json_output.is_a?(String)
          json_engine = Rabl.configuration.json_engine
          json_output = if json_engine.respond_to?(:dump)
            json_engine.dump(json_output)
          else
            json_engine.encode(json_output)
          end
        end

        use_callback = Rabl.configuration.enable_json_callbacks && request_params[:callback].present?
        json_output = "#{request_params[:callback]}(#{json_output})" if use_callback

        json_output
      end
Returns data as json embraced with callback when detected
 format_json({ :foo => "bar" }) => "test({ foo : 'bar' })"
 format_json("{ foo : "bar" }") => "test({ foo : 'bar' })"