basic crud functionality, needs refactoring :)