Got almost 80% test coverage of AnkiServer/apps/rest_app.py and fixed some bugs.