Updated db structure and added zapi lib