[KK] Use toJson() method where appropriate to ensure proper escaping