added file model tests and fixed bugs in file model