refactor app api to CRUD