Adding basic middleware structure