build structured interface for json api