user js refactor, category fix

if a category that didn't exist was request with category/1231 or
api/category/1231 it was crashing.