API call working on setInterval of 30s, displaying data when rescode == 200, displays 'API ERROR' when rescode != 200. Basic script