introduce undefined check for options parameter in api function call