fix rest api to use proper json