Remove last comma character from appended JSON string,
Append ‘]}’ to the end of the file with results