balance() API and fix for functions that return a value (e.g. transactions())