Added functions and Queries for Purchases