Add more unit tests for the API

Unit tests can never hurt, so let's add a couple more :-)

While doing this, I also came across a slight issue with `getAttachments`. Currently when no attachments are present in a file, the function will return `undefined` which causes the test to timeout. I've changed the function to instead return `null`, which fixes these issues (and is also consistent with e.g. `getOutline`).