Improve URL construction when requesting file

Closes #69