automatically parse and encode json for requests