added some examples and JSON support