fetch result from api and pass it to view