give proper termination reason when data isn't json
send correct data for decoding
white space and correct return matching