make simple json api and tests