better logging and fixed call to POST instead of PUT