Added code to use 'id' from the request if exists