             }
         }
         
-        // since there's currently no API to refresh multiple forms, send a request per form
-        for form in forms {
-            numRefresh = 0
-            totalSuccess = true
-            
-            refresh(formId: form.id, {success in
-                // Assumes this callback is invoked on the UI thread, so no need for synctonization
-                self.numRefresh += 1
-                self.totalSuccess = self.totalSuccess && success
-                
-                if (self.numRefresh >= self.forms.count) {
-                    callback?(self.totalSuccess)
-                }
-            })
-        }
+        refresh(formIds: forms.map({$0.id}), callback)
     }
     
     func remove(formId: Int) {

        }
    }
    
    func refresh(formId: Int, _ callback: ((Bool) -> Void)?) {
        let url = URL(string: SecondHand.refreshUrl + String(formId))!
        
        URLSession.shared.dataTask(with: url, completionHandler:{(data, response, error) -> Void in


import Foundation

class SecondHand {
    private static let refreshUrl = "https://api.sf-f.org.il/yad2/form?formIds="
    private static let fileName = Convention.name + "SecondHand.json";
    private static let cacheFile = NSHomeDirectory() + "/Library/Caches/" + "1_" + fileName;
    
    var cache = Cache(forms: [], lastRefresh: nil)
    var forms: Array<SecondHand.Form> {
