misc fixes

These are the fixes that came out of staging testing. Some of these would be caught if we had tests that requests to a given endpoint correctly invoked the instance of the database. I could add tests for those, but this code changes so rarely I thought it wasn't worth it until we needed to change the code. lmk what you think.