API : Sending error headers if needed