Raise NotFound when an invalid ID is passed

Change-Id: I209dabc8b240ab9ea0e1684dcdd35f82dafaefa1