fixed not returning data properly from the API