       uri.scheme = "https"
     else
       uri.query.client_id    = this.options.client_id
-  
+
     uri
 
 ##################################


  prepareRequestURI: (path, query={}) ->
    uri = new SC.URI(path, {"decodeQuery": true})
    
    # shallow merge of queries
    for own k,v of query
      uri.query[k] = v
    
    # add scheme & host if relative
    if uri.isRelative()
      uri.host = this.hostname("api")

      callbacks: {}
      randomCallbackName: ->
        "CB" + parseInt Math.random() * 999999, 10

      get: (uri, callback) ->
        callbackName        = this.randomCallbackName()
        uri.query.format = "js"
        uri.query.callback = "SC.Helper.JSONP.callbacks." + callbackName
        SC.Helper.JSONP.callbacks[callbackName] = callback

        SC.Helper.loadJavascript uri.toString(), ->
          document.body.removeChild(this)
