API error handling
When an API call one should sometimes revert the change locally and warn the user.
For instance, one click one favorite a document, and the API call fails. The frontend should catch the exception and remove the document from the local state of favorites docs.
- favorite docs
- deleted docs
...
(I think the ngrams table is less affected due to patches)