                     resultSets.append(self!.appendSQLite(statement: stmt)) }
             }
         }
-        
+
         if resultSets.count > 0 {
             var lastRow = resultSets.removeLast()
             lastRow["last"] = true
             resultSets.append(lastRow)
         }
-        
+
         values = [Constants.Mustache.products: resultSets]
         return values
     }
-    
+
     private func appendSQLite(statement stmt: SQLiteStmt) -> [String:Any] {
         // We got a result row
         // Pull out the values and place them in the resulting values dictionary

    func valuesForResponse(context: MustacheEvaluationContext, collector: MustacheEvaluationOutputCollector) throws -> MustacheEvaluationContext.MapType {
        var values = MustacheEvaluationContext.MapType()
        var resultSets: [[String:Any]] = []
        
        // Grab the WebRequest
        if let request = context.webRequest where request.requestMethod() == "GET" {
            
            // Try to get the last tap instance from the database
            let sqlite = try SQLite(SAHandlerProducts.trackerDbPath)
            defer {
                sqlite.close()
            }
            
            let queries = request.queryParams
            if queries.count > 0 {
                for query in queries {


enum ResponseCode:String {
    case OK, NOK, PRS
}

struct Constants {
    struct Mustache {
        static let result = "result"
        static let count = "count"
        static let products = "products"
    }
}

// Handler class
