Making the api backend typesafe - TanStack