adding loading message, handling case where json convert fails, and fixing linting errors