Adding some error checking to prevent a malformed JSON file from crashing the app.