Dependency injection and rest calls