added endoapply tests