Add entities to the database