Updated saving output process

Updated the output methods to ensure the final file output is in JSON
format