[TASK] Add function for writing target JSON file  - closes #19