Added error checking for non-json files and wrong viewer/beats file

#59 
I added a try/catch block to catch SyntaxErrors, which appear if the file is not a .json format, and also an if-block which alerts the user if the file is the wrong .json file (viewer/beats). Is this about what we want?
This is an issue in a couple of other lines in this file also