widget session : test branche api and refactoring code