     }
     
     /// Used internally to serialize a `Column` model to JSON.
-    public func toJSON() -> JSON {
-        var json = [String: JSON]()
-        json["key"] = .string(key)
-        json["type"] = type?.toJSON()
-        json["goal"] = goal?.toJSON()
+    public func toJSONObject() -> Any {
+        var json = [String: Any]()
+        json["key"] = key
+        json["type"] = type?.rawValue
+        json["goal"] = goal?.rawValue
         if let isObjective = isObjective {
-            json["is_objective"] = .bool(isObjective)
+            json["is_objective"] = isObjective
         }
         json["range"] = range?.toJSON()
         if let preference = preference {
-            json["preference"] = .array(preference.map { .string($0) })
+            json["preference"] = preference
         }
         if let significantGain = significantGain {
-            json["significant_gain"] = .double(significantGain)
+            json["significant_gain"] = significantGain
         }
         if let significantLoss = significantLoss {
-            json["significant_loss"] = .double(significantLoss)
+            json["significant_loss"] = significantLoss
         }
         if let insignificantLoss = insignificantLoss {
-            json["insignificant_loss"] = .double(insignificantLoss)
+            json["insignificant_loss"] = insignificantLoss
         }
         if let format = format {
-            json["format"] = .string(format)
+            json["format"] = format
         }
         if let fullName = fullName {
-            json["full_name"] = .string(fullName)
+            json["full_name"] = fullName
         }
         if let description = description {
-            json["description"] = .string(description)
-        }
-        return .dictionary(json)
+            json["description"] = description
+        }
+        return json
     }
     
     /// Used internally to initialize a `Column` model from JSON.

    }
    
    /// Used internally to serialize a `Problem` model to JSON.
    public func toJSON() -> JSON {
        var json = [String: JSON]()
        json["columns"] = .array(columns.map { column in column.toJSON() })
        json["options"] = .array(options.map { option in option.toJSON() })
        json["subject"] = .string(subject)
        return .dictionary(json)
    }
    
    /// Used internally to initialize a `Problem` model from JSON.

        }
        name = try? json.getString(at: "name")
        descriptionHTML = try? json.getString(at: "description_html")
        appData = try json.getJSON(at: "app_data")
    }
}
