Assign repeated API call to variable