added new field to count purchases of treasures, and ajax method to perform a purchase