api.request: don't rely on response.json data