     
     override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
 
-        let group = visibleGroups[indexPath.item]
+        let group = visibleGroups()[indexPath.item]
+//        let group = visibleGroups[indexPath.item]
 
         let cell = UITableViewCell(style: .Subtitle, reuseIdentifier: "groupCell")
         cell.textLabel?.text = group.description

            return
        }

        guard let idx = findGroupIndexById(groups, archivedGroup: visibleGroups[indexPath]) else {
            return
        }

        groups[idx].archived = false
        visibleGroups[indexPath].archived = false
        API.putGroup(visibleGroups[indexPath])
        .onSuccess{group in
            NSNotificationCenter.defaultCenter().postNotification(NSNotification(name: "setArchiveButtonValue",object:false))
        }
        .onFailure {
            err in
            self.groups[idx].archived = true
            self.visibleGroups[indexPath].archived = true
        }
    }




    override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
        
        var archivedStatus = visibleGroups()[indexPath.item].archived

        visibleGroups()[indexPath.item].archived = !archivedStatus
        API.putGroup(visibleGroups()[indexPath.item])
        .onSuccess {
            group in
            self.tableView.reloadData()
        }
        .onFailure {
            err in
            self.visibleGroups()[indexPath.item].archived = archivedStatus
        }
    }

