Added the before_first_request override to prevent initialization being run twice