Fix issue when REST endpoint is not working