         ]
     }
 
-    
-    ///
-    public func getHistoryList(success: (response: [HistoryItem]) -> (), error failure: ErrorCallback) {
+    ///
+    public func getHistoryList(filters: [String: [String]], success: (response: [HistoryItem]) -> (), error failure: ErrorCallback) {
         if !dirty { // return cached elements if not dirty
             // load items to view
-            if let historyItems = self.getHistoryItems() {
+            if let historyItems = self.getHistoryItems(filters) {
                 success(response: historyItems)
             } else {
                 failure(error: NSError(domain: "didnt get history items", code: -12351223, userInfo: nil)) // TODO: call error callback if there were realm problems

    }
    
    ///
    private func getHistoryItems() -> [HistoryItem]? {
        if let realm = try? Realm() {
            let query = realm.objects(StoredHistoryItem.self).sorted("timestamp", ascending: false)
            
            return query.flatMap({ storedItem in
                logger.debug("\(storedItem.model)")


            logger.debug("distinct network types: \(distinctNetworkTypes)")
            logger.debug("distinct models: \(distinctModels)")
            
            logger.debug("COUNT1: \(realm.objects(StoredHistoryItem.self).filter("model IN %@", distinctModels).count)")
            logger.debug("COUNT2: \(realm.objects(StoredHistoryItem.self).filter("model IN %@", [distinctModels.first!]).count)")
            logger.debug("COUNT3: \(realm.objects(StoredHistoryItem.self).filter("model IN %@", [distinctModels.last!]).count)")
        }
    }
    
