only execute api request if required parameters are defined