 
     if com=="raml"
       @composer.headers["Accept"] = "text/yaml"
-      url = "/app/#{@getAppId()}/raml?identification_hash=74d6cf00e52215801b6f9968e916c4558da4a79fd4026268b3e5f2cb12e7e90f"
+      identification_hash = '74d6cf00e52215801b6f9968e916c4558da4a79fd4026268b3e5f2cb12e7e90f'
+      url = "/app/#{@getAppId()}/raml?identification_hash=#{identification_hash}"
+
       @composer.get(url, (err, req, res, obj) =>
         raml_file_content = res['body']
 
         console.log raml_file_content
 
-        stream = fs.createWriteStream('www/local.raml')
-        stream.once('open', (fd) ->
-          stream.write raml_file_content
-          stream.end()
+        fs.writeFile('www/local.raml', raml_file_content, (err,data) ->
+          console.log 'raml saved'
         )
+
+        #stream = fs.createWriteStream('www/local.raml')
+        #stream.once('open', (fd) ->
+        #  stream.write raml_file_content
+        #  stream.end()
+        #)
       )
 
     if com=='sync'
       raml = fs.readFileSync('www/local.raml', 'utf8')
 
-      console.log raml
-
-      doc = yaml.safeLoad(fs.readFileSync(data_definition_path, 'utf8'))
+      config = yaml.safeLoad(fs.readFileSync(data_definition_path, 'utf8'))
       if doc.browser_id?
         # browser instance exists
         DbBrowser.put("ramls/#{doc.browser_id}", {raml:{content:raml} }, (err, res, body) =>


    if com=='provision'

      config = yaml.safeLoad(readConfig())

      if config.resourceProviderUid?
        console.log 'dolanddb provider exists already'

        config = yaml.safeLoad(fs.readFileSync(data_definition_path, 'utf8'))
        config.resourceProviderUid = obj['uid']

        fs.writeFile(data_definition_path, yaml.safeDump(config), (err,data) ->
          console.log 'dolandb resource provider created'
        )
