code: private void validateContract(final Contract contract)
              throws RegistrationException {
          final String id = getApiId(contract);
  
          try {
              Get get = new Get.Builder(getIndexName(), id).type("api").build(); //$NON-NLS-1$
              JestResult result = getClient().execute(get);
              if (!result.isSucceeded()) {
                  String apiId = contract.getApiId();
                  String orgId = contract.getApiOrgId();
                  throw new ApiNotFoundException(Messages.i18n.format("ESRegistry.ApiNotFoundInOrg", apiId, orgId));  //$NON-NLS-1$
              }
          } catch (IOException e) {
              throw new RegistrationException(Messages.i18n.format("ESRegistry.ErrorValidatingClient"), e); //$NON-NLS-1$
          }
      }
docs: Ensures that the api referenced by the Contract at the head of
  the iterator actually exists (is published).
  @param contract
  @param apiMap