figuring out main query. using asynch on app.coffee. having difficulties