Added create and update database functionality