data returns undefined from GET request