more tests and refactoring
add necessary constructors for serialization, add execute method in query2 resource