Refactor retrying
Raise error if li returns error
Add save-all subcommand