Adding serverside database code