Refactoring of Dispute and dispute API handlers