<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def api_token_required(f, *args, **kwargs):
 """ Decorator helper function to ensure some methods aren't needlessly called without an api_token configured. """

    try:
        if args[0].api_token is None:
            raise AttributeError('Parameter api_token is required.')
    except AttributeError:
        raise AttributeError('Parameter api_token is required.')

    return f(*args, **kwargs)