code: public String resource_to_string(base_resource resources[], options option, String onerror)
  	{
  		String objecttype = resources[0].get_object_type();
  		String request = "{";
  		 
  		if ( (option != null && option.get_action() != null) || (!onerror.equals("")) )
  		{
  			request = request + "\"params\":{";
  		
  			if (option != null)
  			{		
  				if(option.get_action() != null)
  				{	
  					request = request + "\"action\":\"" + option.get_action()+"\",";
  				}
  			}
  			
  			if((!onerror.equals("")))
  			{			
  				request = request + "\"onerror\":\"" + onerror + "\"";			
  			}
  			request  = request + "},";
  		}
  		
  		request = request + "\"" + objecttype + "\":[";
  		for (int i = 0; i < resources.length ; i++) 
  		{
  			String str = this.resource_to_string(resources[i]);
  			request = request + str + ",";
  		}
  		request = request + "]}";
  		return request;
  	}
docs: Converts MPS resources to Json string.
  @param resources nitro resources.
  @param option options class object.
  @return returns a String