iriyazuddin The CORS error you see intermittently is likely related to the API returning a 429 - rate limited. That will almost certainly result in the CORS problem.
Are you based in India or Pakistan? There seems to be an ongoing issue with too many shared ips which results in the 429.
If you share your ip address I can have a look.