finished closure and JSON Object code and tests