latest apim 1.7.1 changes

latest 1.7.1 changes has been applied here.