def delete_accounts(userid, accounts_id):
        try:
            if UserService.get_user(userid):
                AccountService.get_account_id(accounts_id)
                AccountService.delete_account(accounts_id)
                return '', 204

        except ResourceNotFound as rf:
            rf.message
            return "Account does not exist", 404
 def get_account_id(account_id):
     try:
         account = AccountService.get_account_id(int(account_id))
         return jsonify(account.json()), 200
     except ValueError as e:
         return "Not a valid ID     or No such user exist with this ID", 400  # Bad Request
     except ResourceNotFound as r:
         return r.message, 404
 def get_accounts(userid, accounts_id):
     try:
         if UserService.get_user(userid):
             acct = AccountService.get_account_id(int(accounts_id))
             return jsonify(acct.json()), 200
     except ValueError as e:
         return f"{userid} is not a valid ID", 400
     except ResourceNotFound as rf:
         rf.message
         return "Account does not exist", 404
 def get_user_account(user_id, account_id):
     try:
         user = UserService.get_user(int(user_id))
         account = AccountService.get_account_id(account_id)
         # return jsonify(str(user), str(account)), 200
         return jsonify(user.json(), account.json()), 200
     except ValueError as e:
         return "Not a valid ID or No such user exist with this ID", 400  # Bad Request
     except ResourceNotFound as r:
         return r.message, 404