correct JSON path generation in the API

Signed-off-by: Jan Dvořák <mordae@anilinux.org>