changed badRequest to serverError