Updates to API with some error checking and prevent duplicates from being created.