updated the contract api