Added ResponsePair class for better error handling

This should allow handling for different kinds of failures - networks or
authentication.