Change authenticate middleware to check app pages instead of static pages, seperate statistics.