           steroidsCli.debug "PROVIDER", "Creating a new provider #{@name} ID: #{@typeId} to cloud returned failure: #{JSON.stringify(obj)}"
           reject new CloudWriteError err
 
-        @apiClient.close()
+        @legacyClient.close()
 
   fromCloudObject: (obj)=>
     steroidsCli.debug "PROVIDER", "Updating attributes for provider from object: #{JSON.stringify(obj)}"


      url = "/app/#{dataHelpers.getAppId()}/service_providers.json"
      steroidsCli.debug "PROVIDER", "POSTing #{JSON.stringify(data)} to URL #{url}"
      @apiClient.post url, data, (err, req, res, obj) =>
        if obj.uid
          steroidsCli.debug "PROVIDER", "Creating a new provider #{@name} ID: #{@typeId} to cloud returned success: #{JSON.stringify(obj)}"


      url = "/app/#{dataHelpers.getAppId()}/raml.yaml?identification_hash=#{dataHelpers.getIdentificationHash()}"

      steroidsCli.debug "PROVIDER", "GETting from URL: #{url}"

      @apiClient
        method: "get"
        url: url
      , (err, res, body) =>

        if err?
          steroidsCli.debug "PROVIDER", "Getting current data configuration from cloud returned failure: #{err}"
