Changed output of fetch and getPurchases from array to hashmap with product id keys