refactor code

1. move api functions under /api/ prefix path
2. add api functions for ent_list and ent