add a ResponseWriter compatible API