refactor api index