ugly initial implementation of basic json representation
basic resource definition
tidied up resource representation