Use template.
Fix wrong usage.
Update requirements.txt
Add missing template.
Add 'query'
Support JSON and make index work.