Assessing ecological function in the context of species recovery