refactor in order to allow debits and credits to be created in the same way that other resources are created