Remove deprecated api usage, add schema update queries