transfer api to collection file and added general code for picking file depends on deployment type