Add middleware framework