added key and category queries to the api