_apiServer.loginUser(session, username[0], pwd, domainId, domain, params);
auditTrailSb.insert(0,"(userId="+session.getAttribute("userid")+
" accountId="+ ((Account)session.getAttribute("accountobj")).getId()+
" sessionId="+session.getId()+ ")" );
String loginResponse = getLoginSuccessResponse(session, responseType);
<BUG>writeResponse(resp, loginResponse, false, responseType);
</BUG>
return;
} catch (CloudAuthenticationException ex) {
try {

_apiServer.loginUser(session, username[0], pwd, domainId, domain, params);
auditTrailSb.insert(0,"(userId="+session.getAttribute("userid")+
" accountId="+ ((Account)session.getAttribute("accountobj")).getId()+
" sessionId="+session.getId()+ ")" );
String loginResponse = getLoginSuccessResponse(session, responseType);
writeResponse(resp, loginResponse, HttpServletResponse.SC_OK, responseType);
return;
} catch (CloudAuthenticationException ex) {
try {
