Issue refs #1721: fix server file-related api, implement file downloading