use JSON.dumps to encode username