Improve error handling and grabbing data from the request response

See #1 for more background on this PR.