Properly sets self.app after calling init_app