general purpose api wrapper around sqlite db's to return json