change authentication to support json