added code to read from API