Replaced throws clause with try-catch statements in REST Endpoints.