code formatting, lint checking, json error handling

Updated code formatting, added minor error handling for JSON syntax