Break up API client into per-resource client and common code
Merge pull request #995 from csrwng/refactor_api_client

Break up API client into per-resource client and common code