remove unused function
add tests for if record already exists
add write function which makes sure only one record exists