def transfer_funds(client_id, account1_id, account2_id):
        clienty = get_client(client_id)
        if clienty[1] == 404 or clienty[1] == 400:
            return clienty

        accounty1 = get_account_for_client(client_id, account1_id)
        if accounty1[1] == 404 or accounty1[1] == 400:
            return accounty1

        accounty2 = get_account_for_client(client_id, account2_id)
        if accounty2[1] == 404 or accounty2[1] == 400:
            return accounty2

        try:
            change = request.json
            if "transfer" in change.keys():
                new_account1 = BankingService.withdraw_funds(client_id, account1_id, change["transfer"])
                new_account2 = BankingService.deposit_funds(client_id, account2_id, change["transfer"])
                return jsonify([new_account1.json(), new_account2.json()]), 200
            else:
                return "Please enter an amount to transfer.", 400
        except decimal.InvalidOperation:
            logging.warning("Must deposit or withdraw a numeric amount.")
            return "The amount to deposit or withdraw must be numeric.", 400
        except InsufficientFunds as e:
            logging.warning("Attempted to withdraw more funds than exist in account.")
            return e.message, 422
    def deposit_or_withdraw(client_id, account_id):
        clienty = get_client(client_id)
        if clienty[1] == 404 or clienty[1] == 400:
            return clienty

        accounty = get_account_for_client(client_id, account_id)
        if accounty[1] == 404 or accounty[1] == 400:
            return accounty

        try:
            change = request.json
            if "deposit" in change.keys() and "withdraw" in change.keys():
                return "Please choose to either deposit or withdraw, not both.", 400
            elif "deposit" in change.keys():
                new_account = BankingService.deposit_funds(client_id, account_id, change["deposit"])
                return jsonify(new_account.json()), 200
            elif "withdraw" in change.keys():
                new_account = BankingService.withdraw_funds(client_id, account_id, change["withdraw"])
                return jsonify(new_account.json()), 200
            else:
                return "Please choose to either deposit or withdraw.", 400
        except decimal.InvalidOperation:
            logging.warning("Must deposit or withdraw a numeric amount.")
            return "The amount to deposit or withdraw must be numeric.", 400
        except InsufficientFunds as e:
            logging.warning("Attempted to withdraw more funds than exist in account.")
            return e.message, 422