Fix typo in referencing status code.

There is no such attribute as `Response.status`.
Plus the name of the Response object is `response`, not `r`.

http://docs.python-requests.org/en/latest/api/#requests.Response.status_code
Check response headers before parsing as JSON.

Satisfies the case where the server (not the app) does not respond
properly. Otherwise we end up parsing something that's probably not JSON
and json.loads() throws a very unhelpful ValueError.
Remove extra newlines at eof.
Merge pull request #1 from oychang/bug/response-failure

Verify response type and fix exception reporting