//Error messages
JSONArray jsonErrors = new JSONArray( (ArrayList) responseMap.get( "errorMessages" ) );
//Prepare the Json response
JSONObject jsonResponse = new JSONObject();
jsonResponse.put( "errorMessages", jsonErrors.toArray() );
jsonResponse.put( "errors", responseMap.get( "errors" ) );
jsonResponse.put( "total", responseMap.get( "total" ) );
jsonResponse.put( "bundleId", responseMap.get( "bundleId" ) );
//And send it back to the user