proper error handling resource not found