Add error handling and parsing of Bad Requests