Problem: did not correctly handle invalid server endpoints

Solution: handle with exception in client dialog.
Merge pull request #44 from hintjens/master

Problem: did not correctly handle invalid server endpoints