Added code to message objects so that it can be used outside of Prime. Added error handling for bad JSON in the request body