implement file reading functionality for server