Throw exception instead of returning (-1,0) when unexpected server error happens

Fixes #26