refactor API views