[#223] Check connection status

* Minor code formatting
Merge pull request #224 from akvo/issue/223-network-check

code checked