This kind of dynamic options are cool but they add complexity. It would be more declarative to create another task that has the desired configuration. 

What do you think about removing the apiMethod argument and allow it to only be configured via the task options?