Make the api command more robust and flexible.

Added dry-run and "-H 'content-type: application/json'" options to the
api script as well as the ability to pass options to curl directly.