Modified script to write logs to disk. Added support for API limits. Fixed issue with url encoding words.