def METHOD_NAME(self, username, password, api, extra={}):
    """
    Registers a new account with the specified
    *username*, *password*, and *api*.
    The *api* must be one of the available APIs
    found in the utils.available_libs dict.
    """
    available_libs = utils.available_libs.keys()
    if not username:
        raise utils.AccountError('Empty username.')
    if not password:
        raise utils.AccountError('Empty password.')
    if api not in available_libs:
        raise utils.AccountError('That API doesn\'t exist.')
    account = {'username': username,
               'password': password,
               'api': api,
               'extra': extra,
               }
    nextnum = self.accounts['next']
    self.accounts['accounts'][nextnum] = account
    self.accounts['next'] += 1
    self._save()