make login use toJson