incorporate WA API
added general query
formatting fix