Implementing better error responses