             "fax": fax,
             "email": email,
             "paid": paid,
-            "ads_enabled": adsEnabled
+            "ads_enabled": adsEnabled,
+            "activeListingCount": activeListingCount
         ]
         if let logo = logo {
             json["logo"] = logo

    }
    
    class func getFeaturedBuilders(in database: Database = Database(), completion: @escaping ([Builder]?)->()) {
        let statement =
            "SELECT \(columns.joined(separator: ",")) " +
            "FROM builders " +
            "WHERE paid = 1"
        fetchBuilders(from: database, withStatement: statement, completion: completion)
    }
    
    class func getBuilders(in database: Database = Database(), completion: @escaping ([Builder]?)->()) {
        let statement =
            "SELECT \(columns.joined(separator: ",")) " +
            "FROM builders "
        fetchBuilders(from: database, withStatement: statement, completion: completion)
    }
    


// MARK: - Routes
extension Builder {

    class func getBuilder(byId id: Int, in database: Database = Database(), completion: @escaping ([Builder]?)->()) {
        let statement =
            "SELECT \(columns.joined(separator: ",")), (SELECT COUNT(1) FROM listings WHERE builderId = builders.id AND active > 0) AS activeListingCount " +
            "FROM builders " +
            "WHERE id = \(id)"
        
