Finished cleaning up the code. In main function everything working just JSON files are not in correct syntax