stats API call and generic API wrapper
rename query var to search from q
fix bad merge