handle 401's specifically if you want

This could be extended for more status codes, but this'll do for a start :)