replaced returning a response with raising an exception