modified to send json with json header