change error HTTP response codes to 400 where appropriate