complete crud functionality