Re-placing of the comma at the end of the line in JSON format