Working on interfacing with the API.

Implemented fetchResource. Tries to fetch a resource multiple times
until successful or exceed the maximum number of retries. Some minor
code cleanup and delinting. Still need to implement rate limiting.