proper http exception handling