now we are keeping track of last json item so we do not write out the final comma after the last entry