made crud operations generic and updated tests