Wrote tests to verify primary keys/uniqueness and fixed code that failed tests also slight refactoring of get_a_* function in tests to make it easier to check for no data