code: static <API, T> Pair<API, ICancelable> proxy(final android.support.v4.app.Fragment fragment, final API api, Util.Consumer<T> resultFnc, Util.Consumer<Exception> errorFnc, Runnable finalFnc) {
  		Class<API> apiClass = (Class<API>) api.getClass();
  		AsyncLoaderInvocationHandler<API, T> handler = new AsyncLoaderInvocationHandler<>(fragment.getActivity(), fragment.getActivity().getLoaderManager(), api, resultFnc, errorFnc, finalFnc);
  		return new Pair<>(apiClass.cast(Proxy.newProxyInstance(apiClass.getClassLoader(), apiClass.getInterfaces(), handler)), handler::cancel);
  	}
docs: main