Merging latest api changes and few bug fixes