Examples fixes

Fixes in the example scripts and apis