moving app js files under app folder, teased out middleware to check project existence