Use better response codes
Start adding some portal tests