Added flat file cache class for APIs and using flock method when writing to cache file