Clean up to networking code.

Error response now says if it's a networking error (i.e. if the code is 200 it's likely a parsing error).