added session on connect API and added support for return values from invoked API functions

Signed-off-by: Michal Bínovský <mbinovsky@sygic.com>