Move api.query to app

And remove api.js