updated get contract to check for file existence before making api call