try/except in case of not JSON file given
minor refactor