refactored add & edit functions to the base.js file and am working to get payments to work