Fix bug that made it impossible to create text annotations

Reclassification of text files as documents in scalarapi.js broke a few
things, including this. Also reworded the "unsupported annotatable
media type" message slightly.