allow spaces in usernames
Move learn api code into own function and wrap with a try block
Merge pull request #197 from p2pu/master

Hotfix for release