Move persistence logic into TodosResource, add missing functionalities