fixed json encoding, added content-type header to curl request