throw a 400 error if any parameter is invalid (such as string for date or id)