Small improvements

Small improvements to the file api impelementation