moved queries for api in ./query_patterns.js