Sending 400 bad request instead of exception