refactor with http-errors

cc @eivindfjeldstad @jonathanong 
hmm, yeah. I think that's a little weird.