Refactor BeenApi operating code to unify exception-handling.