move api to new version and add tests

hi, @dinhviethoa, do you mean we using the `constans.js` to define those `constants`?