Slim Framework middleware