Added .slice from AS and refactored id_attributes in database_model