Better server response handling

fix #11