better logging, better error messages, fixed responses in case of failure.