Improve APIClient to require less HTTP-like context