Started result template, fixed query bug

Title says all