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

This pull request fixes payload formatting for json post requests and adds a content-type header