Wraps JSON.parse in a try/catch, and error messages to a variable to reduce repeating strings.
Camel case ALL THE THINGS
Updates publishComment to return the ID of a newly created comment instead of the entire response object.