refactor api helper and add new commands