improving checkAPI() using JSON properly loaded