added check for isFunction in request when setting callbacks.