API: Set the application name to "api" (if not defined), "remote_self" has an application name as well.
Issue 1158: muting of threads now works with the API as well.
Merge pull request #1166 from annando/1409-issue-1158

issue #1158 - and other stuff that I didn't wanted to merge (I hate GIT)