added check to remove \n chars from json request