Added database code to server