function getCollection(name, schema){
    if (schema) return mongoose.model(name, schema);

    try {
      return mongoose.model(name);
    } catch (err){
      initModel(name, schema);
      return mongoose.model(name);
    }
  }
gets a collection as a mongoose model.

@param name name of the collection
@param schema schema for the model