Make if block responsible only for fetching app
Make if block responsible only for fetching app

(`export_json` already does a deepcopy)

dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq