fix middleware to use new API