Input file check

Added code to check for existence and non-emptiness of input files
FileApi logic changed

FileApi now checks file status and takes appropriate action by itself
instead of returning a status