Retrieve the API client and root resource in main.