code: public <T> T handleResponse(Response response, Type returnType) throws ApiException {
          if (response.isSuccessful()) {
              if (returnType == null || response.code() == 204) {
                  // returning null if the returnType is not defined,
                  // or the status code is 204 (No Content)
                  return null;
              } else {
                  return deserialize(response, returnType);
              }
          } else {
              String respBody = null;
              if (response.body() != null) {
                  try {
                      respBody = response.body().string();
                  } catch (IOException e) {
                      throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap());
                  }
              }
              throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody);
          }
      }
docs: Handle the given response, return the deserialized object when the response is successful.
  
  @param <T> Type
  @param response Response
  @param returnType Return type
  @throws ApiException If the response has a unsuccessful status code or
  fail to deserialize the response body
  @return Type