fixing issue where json response returns html due to innerHTML being used instead of innterText.