http response refactoring, server exception handling