added json header, fixed error message