api end point works, but doens't get correct data