use of correct methods in example for adding elements to a JsonObject