The post method had lost a line which checked if the materialItem was already in the db with the same url. Fixed.