changes for checking network before making api call