refactoredclient  to support the two-step request to get the resources

refactoredclient  to support the two-step request to get the resources