Constant disconnection

@kmoses thanks for your reply!

Yes, I think there is something wrong with API and web communication. @Dave @kennethlimcp
And my javascript code is not stabilized too. I used the example from Tutorial: Spark Variable and Function on One Web Page

I am not familiar with Javascript and I have very little knowledge about web server. I duplicated getJson to retrieve data from API. The example code gets data from API every one second, whether the device is found or not. And it causes delay on API when it cannot retrieve data but constantly calling the API. I assume when certain amount of time delay happens, API blocks or detours to time-out. In that point Particle Core seems still connected, but something that is not reachable status.
I need to optimize calling and publishing it.
And I found out if you give Particle Core to publish data with one second interval, it performs better.