Querying equipment used during a Task execution using Hub API

Hello,

I am trying to create a list of all the equipment that was used during a task execution (e.g. balances, data acquisition) and currently I can find this information by using the pex and the \$reviewData endpoint. The data I am interested in is the pex, whether the step was active or not and the equipment pex (see image below) where the audit signature value is "Instrument Value" and where the step was active. However, my query requires aggregation of all task executions related to a set of method IDs, which means that I need to query anywhere from tens to hundreds of pex guids. I then need to query the \$reviewData endpoint for each pex guid, which results in a JSON response of all parameters, for all steps and for each pex. Since this means the computation time for such a query can be quite long, I'd like to understand if there is a more efficient/direct way to get a unique list of equipment guids that were used at the task level, rather than having to loop through every parameter on every step. 

To simplify the current query logic for clarity: 
1. Acquire list of all pex guids related to a Method ID.
2. Query the \$reviewData endpoint for each pex.

3. For each step, check if active = true, if yes, then for each parameter, if audits > signature = Instrument Value, then get the equipment guid under source and the associated pex.

4. Repeat for each step, and add the equipment guid to the list for that pex if it is has not yet been added to the list.