added measure apis and some fixs