add view queries, command handlers and finish tests. Add update