Testing internet connection and fetching JSON