I know that remix loaders and actions can be used as a API endpoint.
But I have a concern that in loaders and actions, we sometimes redirect users to another page without sending a proper JSON response. If I am consuming APIs from Remix from a mobile app, I would expect JSON response all the time. So what's a better way to deal with that?