@Transactional
    public ContractBean getContract(Long contractId) throws ClientNotFoundException, ContractNotFoundException, NotAuthorizedException {
        return tryAction(() -> {
            ContractBean contract = storage.getContract(contractId);
            if (contract == null)
                throw ExceptionFactory.contractNotFoundException(contractId);

            LOGGER.debug(String.format("Got contract %s: %s", contract.getId(), contract)); //$NON-NLS-1$
            return contract;
        });
    }
Check to see if the contract already exists, by getting a list of all the
client's contracts and comparing with the one being created.
manager/api/rest-impl/src/main/java/io/apiman/manager/api/service/ContractService.java