pass domain properties as json in API

fixes http://manage.dimagi.com/default.asp?147424