adds methods to create instances with foreign keys