Query apps from db