refactoring in resolver and api for new cli