Bug fix to cache.php and w/o cache approach

Fixed a fatal bug that upon making multiple API calls, retrieved
json
data is not parsed correctly.