Added refund endpoints and refactored tests