Tenants API integration and tests. App script extended. Templates fixes. Views extended and fixed.