added more calls and protections + some refactorings for the cosmo manager rest client