api call working and tests passing