Adds addreferenceAPI function for adding multiple references
Smaller changes