refactor for app factories and blueprints, distinguishing API app and front(end) app. closes #89