Fix 400 bad request

Add a lot of debug loggin to catch where we failed

Change-Id: I03726938141a784c270cbb495b215663605e5eb2