work api refactor