cleaning up some stupid errors, central http error handling