added app_by_id and app_by_key