Remove debug lines and move init code to js file
Fix query preparation