Set status code even when in not ajax context