Implemented functions to add data to database