More API additions and fixes.
Merge pull request #3 from robinator/master

More API additions and fixes.