#GT-947: added checks into writeTag json request + extra debug output
#GT-1002: added unit test