Issue Defining hostvars in dynamic inventroy

I have developed a dynamic inventory which is listing the servers and all servers are grouped according to service been run on the a particular server. eg.if abc is the service name on the group of servers then it is grouped as

“abc”: {
“hosts”: [
server1,
server2

],
“vars”: {
}
}

and then i am fetching the variables related to each server from the sql db and listing them inside the _meta-> hostvars->server1 in the inventory file only in json format eg.
“_meta”: {
“hostvars”: {
“server1”: {
“modified_username”: “live”,

Now the problem i m facing is when the more then one service is running on the server then if i fetch for the variables from the db then it is updating the existing server1 variable from previous service to the new one

eg.
if i do a python --list
it is only displaying variable either of the one service for the particular server as it replacing variable for the service with came first.

I want to list all variable for a particular server even if two services are running on the server.

like this

“_meta”: {
“hostvars”: {
server1”: {
“modified_username”: “live”,
}
server1”:{
“modified_username”: “kite”,
}

can someone please help