Improve REST error logging