Added callbacks for onComplete and onError