Fix up database calls and start fixing up getSubcategories.  Fix for SQL exploit.