api: allow username in getacceptedcount

This allows passing a username instead of user_id to the `getacceptedcount` in the api.