fixing output var incorrectly being called as data and removing unnecessary call to setHeaders