[TASK] refactor for api and import