dry the code up by getting category list from API