two patterns are in use here:

get takes a dictionary and finds or creates a matching record

retrieve takes an id and finds a record or returns None