Fix missing api tests

There were still a number of untested webapi routes. I wrote tests for them and fixed the ones with bugs.