rest: properly handle already existing resource