allow setHeaders to accept closures