get hops api refactoring and return assigned