API refactoring. View and api-tester minor fixes.