       path
 
   requestWithOpts = (path, opts, go) ->
-    request (composePath path, opts), go
+    doGet (composePath path, opts), go
 
   encodeArray = (array) -> "[#{join (map array, encodeURIComponent), ','}]"
 

        go error, result.models

  requestModel = (key, go) ->
    request "/3/Models.json/#{encodeURIComponent key}", (error, result) ->
      if error
        go error, result
      else
        go error, head result.models

  requestModelBuilders = (algo, go) ->
    request "/2/ModelBuilders.json/#{algo}", go

  requestModelInputValidation = (algo, parameters, go) ->
    post "/2/ModelBuilders.json/#{algo}/parameters", parameters, go

  requestModelBuild = (algo, parameters, go) ->
    post "/2/ModelBuilders.json/#{algo}", parameters, go

  requestModelMetrics = (modelKey, frameKey, go) ->
    post "/3/ModelMetrics.json/models/#{encodeURIComponent modelKey}/frames/#{encodeURIComponent frameKey}", {}, go

  link _.requestInspect, requestInspect
  link _.requestFrames, requestFrames

H2O.Proxy = (_) ->
  doGet = (path, go) ->
    $.getJSON(path)
      .done (data, status, xhr) ->
        go null, data
      .fail (xhr, status, error) ->
        message = xhr.responseJSON.errmsg or 'Unknown error'
        go new Flow.Error message, new Flow.Error "Error calling GET #{path}"

  doPost = (path, opts, go) ->
    $.post(path, opts)
      .done (data, status, xhr) ->
        go null, data
      .fail (xhr, status, error) ->
        message = xhr.responseJSON.errmsg or 'Unknown error'
        go new Flow.Error message, new Flow.Error "Error calling POST #{path} with opts #{JSON.stringify opts}"
  mapWithKey = (obj, f) ->
    result = []
    for key, value of obj
