fix a bug in json response, remove newline from json string before decode