Tiny efficiency change to replicateRest
Minor changes.
Bug fix to allow non main admin to add api keys. Note use base_prefix instead of prefix for universal tables.