created database and load_apps utility function