switched to json and added file close
added case for restarting pipeline check for previously finished cluster jobs