refactoring apiView