fix issues with client's conditional json encoding and auth usage