<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def invokeSmapiApi(rh):
 """ Invoke a SMAPI API. Input: Request Handle with the following properties: function - 'SMAPI' subfunction - 'API' userid - 'HYPERVISOR' parms['apiName'] - Name of API as defined by SMCLI parms['operands'] - List (array) of operands to send or an empty list. Output: Request Handle updated with the results. Return code - 0: ok, non-zero: error """


    rh.printSysLog("Enter smapi.invokeSmapiApi")
    if rh.userid != 'HYPERVISOR':
        userid = rh.userid
    else:
        userid = 'dummy'

    parms = ["-T", userid]
    if 'operands' in rh.parms:
        parms.extend(rh.parms['operands'])

    results = invokeSMCLI(rh, rh.parms['apiName'], parms)
    if results['overallRC'] == 0:
        rh.printLn("N", results['response'])
    else:
        # SMAPI API failed.
        rh.printLn("ES", results['response'])
        rh.updateResults(results)    # Use results from invokeSMCLI

    rh.printSysLog("Exit smapi.invokeCmd, rc: " + str(rh.results['overallRC']))
    return rh.results['overallRC']