added exception catching to API calls and fixed MUST_EXIST usage