[MINOR] Made the directories configurable
[MINOR] Check if the configured directory exists.
[MINOT] Included a simple error handling
[MINOR] Store everything in memory rather than hitting disk on every request