if (!response.ok) {
    let data;
    try {
      data = await response.json();
    } catch (e) {