Restored exception handling in API views.