Fix APIError for requests 1.1

requests 1.1, which is what's available on CentOS 6, doesn't support passing the response code as a keyword argument.  It can be set after the fact on both requests 1.1 and 1.2.

This obsoletes #164.