remove obsolete functions, fix examples

Fix examples so they compile with new API