experimenting with async event handling for javascript calling php methods to get data from database, have a very dirty sort-of-working method to extract data, need to revise