throwing exceptions on 400s and 500s