add error output  and content type for js