Changed init_app() to comply with Application Factory pattern