[api] Refactor