Add more flexibility sugar.js calls

Add some optional parameters ad return types.
Merge pull request #1697 from michelsalib/master

Add more flexibility sugar.js calls