return a 404 when a document does not exist
take advantage of flask-sqlalchemy
/view/id accepts kore argument
redirect to the encoded url
generate a random id for documents

Closes #2