Added oldapi -> newapi conversion for legend