Fix NilClass error when controller has no api version namespace