TLPORTAL-50: make WAPI more reusable