working json input, still need to write tests for it