Check network status before sending JSON requests
working on progress bar