API change in middleware loading