[#1875] John/Kavitha - Added test for malformed json handling and improved error message.