capi: added all session functions and wrappers.