minor fix for api when an env doesn't belong to a profile.