created json API and tests