API tests: fix file handle leak in SBT, thread exhaustion in Travis

I believe I finally have a handle on the multiple problems, and have fixed or worked around them here. What a pain.
Ah, as for calling the ApiServer directly, you should be able to do that, it's just a matter of figuring out which methods to call and encoding the requests in the form Unfiltered expect them to be.