Handle bad status code, proper zcmd parsing

Change-Id: Ifcf2232b3bc75b7cf8b50b0206ad134634685002