       username      : client.context.user
       domainName : data.domainName
       mode          : "vm"
-     
+
     # not working should talk with farslan
     domainManager.dnsManager.removeDNSRecordFromProxy record, callback
 
   @bindVM = secure ({connection:{delegate}}, params, callback)->
-    record = 
+    record =
       mode          : "vm"
       username      : delegate.profile.nickname
       domainName    : params.domainName

      if err then console.log err
      domainList = ({name:domain.domain, id:domain.getId(), vms:domain.vms} for domain in domains)
      callback? err, domains
 
  @isDomainAvailable = (domainName, tld, callback)->
    domainManager.domainService.isDomainAvailable domainName, tld, (err, isAvailable)->
      callback err, isAvailable
  
  @registerDomain = secure (client, data, callback)->
    #default user info / all domains are under koding account.
    params =



  @addNewDNSRecord = secure ({connection:{delegate}}, data, callback)->
    newRecord =
      mode          : "vm"
      username      : delegate.profile.nickname
      domainName    : data.domainName
      linkedVM      : data.selectedVM

    domainManager.dnsManager.registerNewRecordToProxy newRecord, (response)=>
      domain =
        domain       : newRecord.domainName
        orderId      : "0" # when forwarding we got no orderid
        linkURL      : newRecord.domainName
