checking if delegate is set

In APIController delegate is optional why not check if set, if  set nil get method will be executed uselessly