applying 1 condition on resultsof another - Blockchain Data API