add middleware calls - useful for many things like logging