Add status middleware