Basic doubt in converting PDA to DPDA
The DPDA could be constructed by adding explicit states and dropping too permisive epsilon transition.

I will denote accepting state by paranthesis around the name.

$(q_0, \epsilon, Z, (q_f), Z) \text{ accept empty string}$
$((q_f), a, Z, q_a, a)\text{ add initial a (or after cancellation occurs)}\\
((q_f), b, Z, q_b, b)\text{ add initial b (or after cancellation occurs)}\\
(q_a, b, a, q_a, \epsilon) \text{ even out two symbols}\\
(q_b, a, b, q_b, \epsilon) \text{ even out two symbols}\\
(q_a, \epsilon, Z, (q_f), Z) \text{ accept, it happens only with empty stack}\\
(q_b, \epsilon, Z, (q_f), Z) \text{ accept, it happens only with empty stack}\\
(q_a, a, a, q_a, aa)\text{ add another a to stack}\\
(q_b, b, b, q_b, bb)\text{ add another b to stack}$