API - query results in JSON format. fixes #278