Handle all the possible exceptions in REST API and return appropriate HTTP Response Codes