             case "leavePeerGroup":
                 self._leavePeerGroup({ cb($0) })
             case "downloadAndCache":
-                self._downloadAndCache(object["url"]! as! String, path: object["path"]! as! String, isOverwrite: object["isOverWrite"]! as! Bool, cb: { cb($0) })
+                self._downloadAndCache(object["url"]! as! String, path: object["path"]! as! String, isOverwrite: object["isOverwrite"]! as! Bool, cb: { cb($0) })
             case "clearCache":
                 self._clearCache(object["path"]! as! String, cb: { cb($0) })
             case "scanMetadata":

    func _downloadAndCache(url: String, path: String, isOverwrite: Bool, cb: String -> ()) {
        let fileManager = NSFileManager.defaultManager()
        let dir = NSSearchPathForDirectoriesInDomains(.ApplicationSupportDirectory, .UserDomainMask, true).first
        let file = dir?.stringByAppendingString(NSBundle.mainBundle().bundleIdentifier!).stringByAppendingString(path)
        
        // skip download if file is already existed
        if (fileManager.fileExistsAtPath(file!) && !isOverwrite) {
            cb("The \(file) is already existed.")
            return
        }
        

    func _clearCache(path: String, cb: String -> ()) {
        let fileManager = NSFileManager.defaultManager()
        let dir = NSSearchPathForDirectoriesInDomains(.ApplicationSupportDirectory, .UserDomainMask, true).first
        let file = dir?.stringByAppendingString("/" + NSBundle.mainBundle().bundleIdentifier! + path)
    
        do {
            try fileManager.removeItemAtPath(file!)
        } catch let error as NSError {
            print(error.localizedDescription)
        }
        cb("'`\(file!)` had been cleared.'")
    }
    
    /**
