Server connection: fix and test

URLError is now defined for python3 and (json) format problem caught.