raise exception when status = 404 or 400