finish the function that loads JSON data if there is no data present in localStorage