link api refactor