Added additional logic to generate properly-formed JSON string to send to the callback.

#67345704