refine some codes: use logging, change response handler

Change-Id: If9167be783f52996e2d6df74d1f2eebe31b66f77