added the dynamic filling of #database, added initial json conversion in alrt state