#488 Some bugfixes in api and adding more examples