updated docs and tests to handle JSON input