ResourceNotFoundException handling added