updated server side db hadnling