Refactor: use idAttribute to communicate with Backend (MongoDB)