add tests
move json parsing out of remote