Added search functionality and updated insert and update