Adding basic endpoint middleware