Early draft

I'm not suggesting that we merge any of this but a PR makes it easier to discuss.
Can you do this next bunch of stuff without mutablity of status and body? i.e. each of the if/else blocks returns a tuple (status, body)?