send application/json content-type for puts and posts
use response.json instead of parsing response.text