code: @Override
  	public Response changeInstanceState( String applicationName, String newState, String instancePath ) {
  
  		this.logger.fine( "Request: change state of " + instancePath + " to '" + newState + "' in " + applicationName + "." );
  		Response response = Response.ok().build();
  		String lang = lang( this.manager );
  		try {
  			ManagedApplication ma;
  			Instance instance;
  			if( ! InstanceStatus.isValidState( newState ))
  				response = handleError( Status.FORBIDDEN, new RestError( REST_INEXISTING, name( newState )), lang ).build();
  
  			else if(( ma = this.manager.applicationMngr().findManagedApplicationByName( applicationName )) == null )
  				response = handleError( Status.NOT_FOUND, new RestError( REST_INEXISTING, application( applicationName )), lang ).build();
  
  			else if(( instance = InstanceHelpers.findInstanceByPath( ma.getApplication(), instancePath )) == null )
  				response = handleError( Status.NOT_FOUND, new RestError( REST_INEXISTING, instance( instancePath ), application( applicationName )), lang ).build();
  
  			else
  				this.manager.instancesMngr().changeInstanceState( ma, instance, InstanceStatus.whichStatus( newState ));
  
  		} catch( IOException | TargetException e ) {
  			response = RestServicesUtils.handleError(
  					Status.FORBIDDEN,
  					new RestError( ErrorCode.REST_UNDETAILED_ERROR, e ),
  					lang ).build();
  
  		} catch( Exception e ) {
  			response = RestServicesUtils.handleError(
  					Status.INTERNAL_SERVER_ERROR,
  					new RestError( ErrorCode.REST_UNDETAILED_ERROR, e ),
  					lang ).build();
  		}
  
  		return response;
  	}
docs: /*
  (non-Javadoc)
  @see net.roboconf.dm.internal.rest.api.IApplicationWs
  #changeInstanceState(java.lang.String, java.lang.String, java.lang.String)