Added database functionalities