implments the basic crud function