don't submit when cancelling
rewrite queries with criteria for more flexibility
allow ordering (fix #30)