catch and trace HTTP Error 400: Bad request
Improved exception handling
Improved tracing