refactor: simple api code