Add task finishing logic and open task query
Resolve merge conflicts and fix minor bugs