Minor refactoring and drop ServerException
Fix 500 status