add database wrapper from plan your picnic
ads.stat helper functions