api changes
memory leaks fixes