added limit offset feature to query, modified query api as http stream
warning clean up.