refactor and take add_meta_data out of basecontroller