Proper formatting of error responses